package com.youzan.cloud.component.biz.member.common.util;


import com.youzan.cloud.component.biz.member.dto.BaseResult;

/**
 * @author tangsen233
 * @version 1.0
 * @description: TODO
 * @date 2021/8/4 17:07
 */
public class OutResultUtil {

    public static BaseResult fail(String errorMessage, String code, Object data) {
        BaseResult baseResult = new BaseResult();
        baseResult.setMessage(errorMessage);
        baseResult.setData(data);
        baseResult.setCode(code);
        baseResult.setSuccess(false);
        return baseResult;
    }

    public static BaseResult success(Object data) {
        BaseResult baseResult = new BaseResult();
        baseResult.setMessage("执行成功");
        baseResult.setData(data);
        baseResult.setCode("200");
        baseResult.setSuccess(true);
        return baseResult;
    }
}